<?php

namespace backend\modules\orders\models;

use Yii;

/**
 * This is the model class for table "cservice".
 *
 * @property string $cservice_id
 * @property string $order_goods_id
 * @property string $content
 * @property integer $cservice_type
 * @property string $images
 * @property string $is_deal
 * @property string $created_at
 * @property string $user_id
 * @property string $cservice_code
 */
class Cservice extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'cservice';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['cservice_id', 'order_goods_id', 'content'], 'required'],
            [['content','cservice_code'], 'string'],
            [['cservice_type','is_deal','created_at'], 'integer'],
            [['cservice_id', 'order_goods_id','user_id'], 'string', 'max' => 40],
            [['images'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'cservice_id' => Yii::t('app', 'Cservice ID'),
            'order_goods_id' => Yii::t('app', 'Order Goods ID'),
            'content' => Yii::t('app', 'Content'),
            'cservice_type' => Yii::t('app', 'Cservice Type'),
            'images' => Yii::t('app', 'Images'),
        ];
    }

    /**
     * @inheritdoc
     * @return \backend\modules\orders\models\query\CserviceQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \backend\modules\orders\models\query\CserviceQuery(get_called_class());
    }
}
